package com.ds.infrastructure.hyperspace.common;

import lombok.Getter;

/**
 * @author  Weishaoying
 */
public enum EndpointProtocolEnum {
    /**
     * http protocal
     */
    HTTP(false, false, 1),

    /**
     * https protocal
     */
    HTTPS(true, false, 2),

    /**
     * websockets protocal
     */
    WEBSOCKET(false, true,  3),

    /**
     * websocket protocal
     */
    WEBSOCKETS(true, true, 4),

    /**
     * http2 protocal with
     */
    HTTP2(true, true, 5),

    /**
     * http2 protocal with cleartext
     */
    HTTP2C(false, true,  6);


    private boolean useTls;

    @Getter
    private boolean isLongLive;

    @Getter
    private int index;

    EndpointProtocolEnum(boolean useTls, boolean isLongLive, int index) {
        this.useTls = useTls;
        this.isLongLive = isLongLive;
        this.index = index;
    }

    public boolean useTls() {
        return useTls;
    }
}
